fix: bound resident finding evidence - #161
Open
sylvesterkaczmarek wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Make the protected post-job hook reject resident network-finding evidence that the Rust producer cannot emit.
Problem
The Rust resident retains at most 1024 network findings. It also records a truncation flag and a lifetime sampled count with a strict relationship to the retained list.
The Action already independently validates the analogous critical-finding bound, but ordinary
findingswere only consumed or sliced downstream. A malformed report could therefore present a non-array, more than 1024 retained findings, or an impossible retained/truncated/sample-count combination without failing the protected post hook.Evidence / reproduction
FindingCollection; the reporting path copies its retained list intoevidence.findings, copies its truncation state intoevidence.findings_truncated, and copies its lifetime sample count intocounters.sampled_violations.sampled_violations == findings.length. Once the retained list is full, further samples set truncation and increase the sampled count, so valid truncated evidence has exactly 1024 retained findings andsampled_violations > 1024.critical_findings, but it has no equivalent producer-contract validation for ordinaryfindings.report.findings.slice(0, 1024)in places. That limits presentation work but does not make an impossible report invalid; extra or inconsistent evidence can be silently ignored rather than rejected.findingsvalue, 1025 retained findings,findings_truncated: truewith only 1023 retained rows, or a non-truncated list whose sampled count exceeds its retained length.action/finding-evidence-bounds.test.ctspins valid producer boundaries at 0, 1, 1024, and first truncation (1024 retained / 1025 sampled), then verifies those impossible combinations are rejected.This is the same trust-boundary principle already applied to critical findings: the protected post hook should accept only evidence states the resident producer can legitimately create.
Change
findings_truncatedto match the producer stateNo firewall, DNS authorization, or report schema behavior changes.